#include "stdlib.h"
#include "common.h"
#include "utils/display.h"

int generate_random(void){
	return (rand() % 89);
}

//绘制参数选中框
// mode = 0 选择P值显示选中框
// mode = 1 选择I值显示选中框
// mode = 2 选择D值显示选中框
// mode = 3 选择target值显示选中框
// mode = 4 全部不显示选中框
void ui_parameter_select_box_bold(int mode)
{
    char select_box_seze = 3;
    switch(mode)
    {
        case 0: //P
            LCD_DrawRectangle(34 - select_box_seze+1, 104 - select_box_seze+1, 104 + select_box_seze-1, 128 + select_box_seze-1, WHITE);
        break;
        case 1: //I
            LCD_DrawRectangle(118 - select_box_seze+1, 104 - select_box_seze+1, 188 + select_box_seze-1, 128 + select_box_seze-1, WHITE);
        break;
        case 2: //D
            LCD_DrawRectangle(202 - select_box_seze+1, 104 - select_box_seze+1, 272 + select_box_seze-1, 128 + select_box_seze-1, WHITE);
        break;        
        case 3: //target
            LCD_DrawRectangle(320-150 - select_box_seze+1, 170-34 - select_box_seze+1, 316 + select_box_seze-1, 166 + select_box_seze-1, WHITE);
        break;
        case 4: //all clean 
            LCD_DrawRectangle(34 - select_box_seze+1, 104 - select_box_seze+1, 104 + select_box_seze-1, 128 + select_box_seze-1, BLACK);
            LCD_DrawRectangle(118 - select_box_seze+1, 104 - select_box_seze+1, 188 + select_box_seze-1, 128 + select_box_seze-1, BLACK);
            LCD_DrawRectangle(202 - select_box_seze+1, 104 - select_box_seze+1, 272 + select_box_seze-1, 128 + select_box_seze-1, BLACK);
            LCD_DrawRectangle(320-150 - select_box_seze+1, 170-34 - select_box_seze+1, 316 + select_box_seze-1, 166 + select_box_seze-1, BLACK);
        break;        
    }
}
